// Author: wsfuyibing <682805@qq.com>
// Date: 2025-05-08

package kind

// BalanceOperate
// 余额账单操作类型.
type BalanceOperate int

const (
	BalanceOperateUnlock BalanceOperate = 30 // 解冻

	BalanceOperateLock        BalanceOperate = 50 // 冻结
	BalanceOperateLockByOrder BalanceOperate = 51 // 因订单冻结

	// BalanceOperateRecharge
	// 充值.
	BalanceOperateRecharge   BalanceOperate = 100
	BalanceOperateWithdrawal BalanceOperate = 101

	// BalanceOperateReturnFishes
	// 钓场回鱼.
	BalanceOperateReturnFishes BalanceOperate = 111

	// BalanceOperateBasanReward
	// 钓点打赏.
	BalanceOperateBasanReward BalanceOperate = 201

	// BalanceOperateBasanRewardIncome
	// 收到打赏.
	BalanceOperateBasanRewardIncome BalanceOperate = 202
)

var (
	balanceOperateText = map[BalanceOperate]string{
		BalanceOperateLock:              "冻结",
		BalanceOperateLockByOrder:       "下单",
		BalanceOperateUnlock:            "解冻",
		BalanceOperateRecharge:          "充值",
		BalanceOperateWithdrawal:        "提现",
		BalanceOperateReturnFishes:      "回鱼",
		BalanceOperateBasanReward:       "打赏",
		BalanceOperateBasanRewardIncome: "收到打赏",
	}

	// 公共页面.
	balanceOperatePageMapper = map[BalanceOperate]string{}

	// 钓场页面.
	balanceOperatePageMapperForArcade = map[BalanceOperate]string{
		BalanceOperateLockByOrder: "me.master.order.detail",
	}

	// 用户页面.
	balanceOperatePageMapperForUser = map[BalanceOperate]string{
		BalanceOperateLockByOrder: "me.order.detail",
	}
)

// Page
// 页面链接.
func (o BalanceOperate) Page() string {
	if str, ok := balanceOperatePageMapper[o]; ok {
		return str
	}
	return ""
}

// ArcadePage
// 用户页面.
func (o BalanceOperate) ArcadePage() string {
	if str, ok := balanceOperatePageMapperForArcade[o]; ok {
		return str
	}
	return o.Page()
}

// UserPage
// 用户页面.
func (o BalanceOperate) UserPage() string {
	if str, ok := balanceOperatePageMapperForUser[o]; ok {
		return str
	}
	return o.Page()
}

// Text
// 操作名称.
func (o BalanceOperate) Text() string {
	if str, ok := balanceOperateText[o]; ok {
		return str
	}
	return ""
}
